package com.example.travel.activity;

import android.content.Intent;
import android.os.Bundle;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ViewFlipper;

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import com.example.travel.R;

/**
 * Created by G on 2020/11/11.
 */

public class WebActivity2 extends AppCompatActivity {
    TextView tv1;

    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.cardview);
        tv1=(TextView)this.findViewById(R.id.tv1);

        ViewFlipper viewFlipper=(ViewFlipper)this.findViewById(R.id.vf);
        viewFlipper.addView(addImgView(R.drawable.fly));
        viewFlipper.addView(addImgView(R.drawable.fly1)) ;
        viewFlipper.addView(addImgView(R.drawable.fly2));
        viewFlipper.setInAnimation(getApplicationContext(),android.R.anim.slide_in_left);
        viewFlipper.setOutAnimation(getApplicationContext(),android.R.anim.slide_out_right);
        viewFlipper.setFlipInterval(2500);
        viewFlipper.startFlipping();



         Intent intent=getIntent();
//        tv1.setText(intent.getStringExtra("date"));
        String strResult="";
        strResult=strResult+intent.getExtras().getString("date")+"\n";
        strResult=strResult+intent.getExtras().getString("date1")+"\n";
        strResult=strResult+intent.getExtras().getString("date2")+"\n";
        strResult=strResult+intent.getExtras().getString("date3")+"\n";
        strResult=strResult+intent.getExtras().getString("date4")+"\n";
        tv1.setText(strResult);

    }


    public View addImgView(int id) {
        ImageView iv=new ImageView(getApplicationContext());
        iv.setBackgroundResource(id);
        return iv;
    }
}
